<div ng-controller="DistributorCtrl" ng-init="listAction()">
    <ul class="sui-breadcrumb">
        <li>{{'代理商'| translate}}</li>
        <li>{{'List'|translate}}
        </li>
        <span class="sui-form sui-form pull-right">
            <fxgrade-list ng-model="grade_id" dft="1"></fxgrade-list>
            <input type="text" placeholder="{{'名称'|translate}}" ng-model="name">
            <input type="text" placeholder="{{'手机号'|translate}}" ng-model="phone">
            <wxinfo ng-model="agentInfo" is-url="1" stye="1"></wxinfo>
            <chose-agent member-check="callbackAgent(agentInfo)"></chose-agent>
            <button class="sui-btn btn-primary" type="submit" ng-click="getList(1)">{{'search'|translate}}</button>
            <export-data type="1" ng-show="distributorList"> </export-data>
            <a href="#/distributor/setup" class="sui-btn btn-primary">设置</a>
            <!-- <span>
                {{'最低提现额度'|translate}}：<input type="text"  placeholder="{{'0.00'|translate}}"  ng-model="minimum"> 元 
                <button class="sui-btn btn-primary" ng-click="setMinimum()">{{'保存'|translate}}</button>
            </span>
        <span>
                设置自动审核等级<shenpi-list ng-model="autosp.grade"  dft="-1" ></shenpi-list>
                <button class="sui-btn btn-primary" ng-click="saveDistributionAutoShenHe()">{{'保存'|translate}}</button>
            </span>
        <span>
                <button id="openDistribution" ng-show="!state" ng-click="operationDistribution(1)" class="sui-btn btn-primary">{{'开启代理功能' | translate}}</button>
                <button id="closeDistribution" ng-show="state" ng-click="operationDistribution(0)" class="sui-btn btn-danger">{{'关闭代理功能' | translate}}</button>
            </span>
        <span>
                <button id="openApplication" ng-show="!auto_state" ng-click="autoShenqing(1)" class="sui-btn btn-primary">{{'开启自动申请' | translate}}</button>
                <button id="closeApplication" ng-show="auto_state" ng-click="autoShenqing(0)" class="sui-btn btn-danger">{{'关闭自动申请' | translate}}</button>
            </span> -->
        </span>
    </ul>

    <distributor-tab ng-model="chosedStatus" click-tab="getList(1)"></distributor-tab>

    <table class="sui-table table-bordered">
        <thead>
            <tr>
                <th>{{'编号'|translate}}</th>
                <th>{{'代理商'|translate}}</th>
                <th>{{'名称'|translate}}</th>
                <th>{{'上一级代理商'|translate}}</th>
                <th>{{'介绍'|translate}}</th>
                <th>{{'代理等级'|translate}}</th>
                <th>{{'待升级代理商等级'|translate}}</th>
                <th>{{'手机号'|translate}}</th>
                <th>{{'状态'|translate}}</th>
                <th>{{'创建时间'|translate}}</th>
                <th>{{'更新时间'|translate}}</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="list in distributorList" ng-if="distributorList">
                <td>{{list.distributor_id}}</td>
                <td>
                    <wxinfo ng-model="list.user_id" stye="1"></wxinfo>
                </td>
                <td>
                    {{list.nick_name}}
                </td>
                <td>
                    <span ng-show="list.father_user_id>0">
                        <wxinfo ng-model="list.father_user_id" stye="1"></wxinfo>
                        <br />
                        <button class="sui-btn btn-small btn-danger" ng-click="clearFatherUser(list.user_id)">x</button>
                    </span>
                    <br />
                    <chose-member title="添加上级代理商" chosed-items="[]" app="1" member-check="addFatherDistributor(memberInfo,list.user_id)"></chose-member>
                </td>
                <td>{{list.introduce}}</td>
                <td>
                    <fxgrade-list ng-model="list.grade_id" stype="1"></fxgrade-list>
                </td>
                <td>
                    <a ng-show="list.upgrade_id > 0" href="#/distributor/info?distributor_id={{list.distributor_id}}&user_id={{list.user_id}}" class="sui-btn btn-primary">{{'同意申请升级'|translate}}</a>
                </td>
                <td> {{list.phone}}</td>
                <td><span ng-show="list.check ==1" class="sui-text-info">未审核</span>
                    <span ng-show="list.check ==2" class="sui-text-success">审核通过</span>
                    <span ng-show="list.check ==3" class="sui-text-danger">审核失败</span></td>
                <td>
                    {{list.created_time | ddtt}}
                </td>
                <td>
                    {{list.updated_time | ddtt}}
                </td>
                <td style="width:100px">
                    <a href="#/distributor/info?distributor_id={{list.distributor_id}}&user_id={{list.user_id}}" class="sui-btn btn-primary">{{'edit'|translate}}</a>
                    <br />
                    <br />
                    <wx-qrcode stype="'FXID'" id="list.distributor_id" title="店铺二维码" spath="pages/JR/order/index"></wx-qrcode>
                    <br />
                    <br />
                    <fx-qrcode fxid="list.distributor_id"></fx-qrcode>
                </td>
            </tr>
        </tbody>
    </table>
    <!-- 分页start -->
    <pager page-no="{{pageNo}}" page-size="pageSize" total="totalCount" get-data="getList(pageNo)"></pager>
    <!-- 分页end -->
</div>